﻿Imports CapaNegocio
Public Class frmConexion

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click

        'SERV = txtservidor.Text
        cC.servidor = txtservidor.Text
        cC.basedato = txtbase.Text
        cC.usuario = txtusuario.Text
        cC.contraseña = txtpass.Text

        cC.LeerYModificarXML()
        cC.mtdLeerConexion()
        'cC.mtdConectar()
        'cC.mtdDesconectar()

        Me.Close()
        'MsgBox(cC.cadenaconexionx)

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelar.Click
        Me.Close()
    End Sub

    Private Sub frmConexion_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        cC.mtdLeerConexion()
        txtservidor.Text = cC.servidor
        txtbase.Text = cC.basedato
        txtusuario.Text = cC.usuario
        txtpass.Text = cC.contraseña
    End Sub

    Private Sub txtbase_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtbase.KeyPress
        If e.KeyChar = ChrW(Keys.Enter) Then
            e.Handled = True
            SendKeys.Send("{TAB}")
        End If
    End Sub
End Class